<template>
  <div class="content">
    <div class="cloud-header">
      <h2>添加门店</h2>
    </div>
    <div class="cloud-body">
      <Form class="add-stores-width" :label-width="110" mode="single" :model="form" :rules="validationRules" ref="form" :top="0.2" showErrorTip>
        <FormItem label="门店名称" prop="store_name">
          <input type="text" placeholder="门店名称，支付时展示" v-model="form.store_name" />
        </FormItem>
        <FormItem label="联系手机" prop="store_phone">
          <input type="text" placeholder="手机号码" v-model="form.store_phone" />
        </FormItem>
        <FormItem label="联系电话" prop="store_tel">
          <input type="text" placeholder="固定电话" v-model="form.store_tel" />
        </FormItem>
        <FormItem label="地区选择" prop="store_name">
          <Address v-model="address_val"></Address>
        </FormItem>      
        <FormItem label="门店地址" prop="address">
          <input type="text" placeholder="街道、楼宇等，省市区省略" v-model="form.address" />
        </FormItem>   
        <FormItem label="门店Logo" prop="store_logo">
          <Upload v-model="form.store_logo"></Upload>
          <!-- <input type="text" v-model="form.store_logo" /> -->
        </FormItem>   
        <FormItem label="门头照" prop="store_door_photo">
          <Upload v-model="form.store_door_photo"></Upload>
          <!-- <input type="text" v-model="form.store_door_photo" /> -->
        </FormItem>
        <FormItem label="营业场所照片" prop="store_location_photo">
          <Upload v-model="form.store_location_photo"></Upload>
          <!-- <input type="text" v-model="form.store_location_photo" /> -->
        </FormItem>   
      </Form>

      <button class="h-btn h-btn-primary add-stores-submit">保存</button>
    </div>
  </div>
</template>
<script type="text/javascript">
import Address from '@/components/address/address'
import Upload from '@/components/upload'
export default {
  components:{
    Address,
    Upload
  },
  data() {
    return { 
      form:{
        sub_merchant_id:'',                                // 商户号
        store_name:'',                                     // 门店名称
        store_phone:'',                                    // 联系手机
        store_tel:'',                                      // 联系电话
        province_code:'',                                  // 省编码
        city_code:'',                                      // 市编码
        area_code:'',                                      // 区编码
        address:'',                                        // 详细地址
        store_logo:'',                                     // 门店logo
        store_door_photo:'',                               // 门头照
        store_location_photo:'',                           // 营业场所照片
        notify_url:'',                                     // 回调通知地址
      },

      address_val:{ },
      // 验证规则
      validationRules:{
        required: [
          // "store_name",
          // "store_phone",
          // "store_tel",

        ],
        mobile:['store_phone'],
        tel:['store_tel']
      }
    }
  },
  /**
   * 页面加载执行
   * @return {[type]} [description]
   */
  mounted() {

  },
  methods: {

  }
}

</script>
<style lang="less" scoped="true">
.add-stores-width{
  width: 50%;
  margin-left: 70px;
}

.add-stores-submit{
  margin-left: 200px;
}

</style>
